#{extends 'ApiDoc/base.html'/}

<script>
    $(function(){
    });
</script>

<link rel="stylesheet" type="text/css"
      href="#{href '/public/apidoc/layout/res_iframe.css'/}"/>

<link rel="stylesheet" href="#{href '/public/apidoc/view.css'/}">

%{apiResult = clazz.getApiResult()}%

<div class="page_doc">
    <div class="main_hd"><h2 id="title">${apiResult ? apiResult.value() : clazz.getSimpleName()}</h2></div>
    <div class="main_bd">
        <div class="article_box">
            <div class="inner">
                <div id="content" class="news_content">

                    <h2>字段说明</h2>

                    #{if apiResult && apiResult.note()}
                    <p>
                        说明：${apiAction.resultNote()} ${apiResult.note()}
                    </p>
                    #{/if}
                    <table class="table">
                        <thead>
                        <tr>
                            <th>字段</th>
                            <th>名称</th>
                            <th>类型</th>
                            <th>备注</th>
                        </tr>
                        </thead>
                        <tbody>
                        #{list items: clazz.getApiResultField(), as: 'field'}
                        %{resultField = field.getApiResultField()}%
                        #{if resultField}
                        <tr>
                            <td class="code-text">${field.getName()}</td>
                            <td>${resultField.value()}</td>
                            <td>
                                #{fieldLink field:field/}
                            </td>
                            <td>
                                ${resultField.note()}
                                #{ifnot resultField.enumType().equals(apidocs.NotEnum.class)}
                                    说明：
                                    #{list items: resultField.enumType(), as:'e'}
                                        ${e.value} ${e.description} ${e_isLast? '':', '}
                                    #{/list}
                                #{/ifnot}
                            </td>
                        </tr>
                        #{/if}
                        #{else}
                        <tr>
                            <td class="code-text">${field.getName()}</td>
                            <td>${field.getName()}</td>
                            <td>
                                #{fieldLink field:field/}
                            </td>
                            <td>-</td>
                        </tr>
                        #{/else}
                        #{/list}
                        </tbody>
                    </table>

                    <h2>Java Class</h2>
                    <pre class="code-text">
/*
 * ${apiResult.value()}
 */
public class ${clazz.simpleName}{
#{list items: clazz.getApiResultField(), as: 'field'}
%{resultField = field.getApiResultField()}%
    //${resultField.value()} ${resultField.note()} #{ifnot resultField.enumType().equals(apidocs.NotEnum.class)} 说明： #{list items: resultField.enumType(), as:'e'} ${e.value} ${e.description} ${e_isLast? '':', '} #{/list} #{/ifnot}

    public ${field.type.simpleName} ${field.name};

#{/list}
}
                        </pre>
                </div>
            </div>
        </div>
    </div>

</div>